<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>机构管理</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">
        function save() {
            var isValidate = jp.validateForm('#inputForm');//校验表单
            if(!isValidate){
				jp.error("必填项不能为空，请检查！");
                return false;
            }else{
                jp.loading();
                jp.post("${ctx}/sys/office/save",$('#inputForm').serialize(),function(data){
                    if(data.success){
                        jp.getParent().refreshNode(data);
                        jp.success(data.msg);
                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                        parent.layer.close(dialogIndex);
                    }else {
                        jp.error(data.msg);
                    }
                })
            }

        }
	</script>
</head>
<body class="bg-white">
	<form:form id="inputForm" modelAttribute="office"  method="post" class="form-horizontal">
		<form:hidden path="parent.id"/>
		<table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
		   	<tbody>
				<tr>
				  	<td class="width-15 active"><label class="pull-right"><font color="red">*</font>机构名称:</label></td>
				  	<td class="width-35">
						<form:input path="name" htmlEscape="false" maxlength="50" class="form-control "/>
					</td>
					<td  class="width-15"  class="active"><label class="pull-right">机构编码:</label></td>
					<td class="width-35">
						<form:input path="code" htmlEscape="false" maxlength="50" class="form-control"/>
					</td>
		      	</tr>

		       	<tr>
					<td class="width-15"  class="active"><label class="pull-right">负责人:</label></td>
					<td class="width-35">
						<sys:userselect id="primaryPerson" name="primaryPerson.id" value="${office.primaryPerson.id}" labelName="office.primaryPerson.name" labelValue="${office.primaryPerson.name}"
										cssClass="form-control" isMultiSelected="false"/>
					</td>
				   	<td class="width-15 active"><label class="pull-right">是否可用:</label></td>
				   	<td class="width-35">
					   	<form:select path="useable" class="form-control">
						   	<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					   	</form:select>
					</td>
			   	</tr>
		      	<tr>
					<td  class="width-15" class="active"><label class="pull-right">备注:</label></td>
					<td colspan="3"><form:input path="remarks" htmlEscape="false" class="form-control"/></td>
				</tr>
					<td class="width-15 active"><label class="pull-right">组织机构ID:</label></td>
					<td class="width-35">
						<div class="col-sm-10 col-md-2">
							<form:input path="id" readonly="true" htmlEscape="false" autocomplete="off"
										class="form-control"/>
						</div>
					</td>

		      	</tr>
	      	</tbody>
	  	</table>
	</form:form>
</body>
</html>
